<?php

namespace Shared\Routers;

class DefaultRouter implements IRouter {
    
    public function getURI() {
//        return  $_SERVER['REQUEST_URI'];
        $request = substr($_SERVER['PHP_SELF'], strlen($_SERVER['SCRIPT_NAME']) + 1) ? : substr($_SERVER['REQUEST_URI'], 1);
        $request = preg_replace('/^' . str_replace('.', '\.',substr($_SERVER['SCRIPT_NAME'],1))  . '/', '', $request);
        return  urldecode(preg_replace('/^\//', '', $request));
//        return  substr($_SERVER['PHP_SELF'], strlen($_SERVER['SCRIPT_NAME']) + 1);
    }
}
